home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 December: Technology Seed / ADC Seed CD - December.toast / FireWire / FireWire_2.2.2_SDK.sit / FireWire 2.2.2 SDK / Interfaces / GenericDriverFamily.h / GenericDriverFamily.h
Encoding:
C/C++ Source or Header  |  1999-09-28  |  4.7 KB  |  196 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        GenericDriverFamily.h
  3.  
  4.     Contains:    Definitions and interfaces for Generic Driver family.
  5.  
  6.     Version:    1.0
  7.  
  8.     Written by:    Erik Staats
  9.  
  10.     Copyright:    © 1996, 1998-1999 by Apple Computer, Inc., all rights reserved.
  11.  
  12.     File Ownership:
  13.  
  14.         DRI:                Jay Lloyd
  15.  
  16.         Other Contact:        
  17.  
  18.         Technology:            FireWire
  19.  
  20.     Writers:
  21.  
  22.         (EA)    Eric Anderson (ewa)
  23.         (jkl)    Jay Lloyd
  24.  
  25.     Change History (most recent first):
  26.  
  27.        <FW7>     7/23/99    EA        Changed type GDFExpertEntryPoint to GDFExpertEntryPointProc.
  28.        <FW6>      8/6/98    jkl        Include dependencies on other header files.
  29.        <FW5>     1/15/98    jkl        Update defines for new interfaces.
  30.        <FW4>      1/4/98    EA        Remove "implement this" comment for
  31.                                     kGDFServiceIsLoadedUponDiscovery.
  32.        <FW3>    10/22/96    ES        Added driverRefNum to GDFDeviceEventData record.
  33.        <FW2>    10/21/96    ES        Filled in contains field.
  34.        <FW1>    10/21/96    ES        first checked in
  35.  
  36. */
  37.  
  38. #ifndef __GENERICDRIVERFAMILY__
  39. #define __GENERICDRIVERFAMILY__
  40.  
  41. #ifndef __NAMEREGISTRY__
  42. #include <NameRegistry.h>
  43. #endif
  44.  
  45. #ifndef __DRIVERSERVICES__
  46. #include <DriverServices.h>
  47. #endif
  48.  
  49. #ifdef __cplusplus
  50. extern "C" {
  51. #endif
  52.  
  53. #if PRAGMA_IMPORT_SUPPORTED
  54. #pragma import on
  55. #endif
  56.  
  57. #if PRAGMA_ALIGN_SUPPORTED
  58. #pragma options align=mac68k
  59. #endif
  60.  
  61. typedef struct OpaqueGDFDeviceEventRegistrationID*        GDFDeviceEventRegistrationID;
  62. typedef struct OpaqueGDFDeviceID*                        GDFDeviceID;
  63.  
  64. enum
  65. {
  66.     kInvalidGDFDeviceEventRegistrationID    = 0,
  67.     kInvalidGDFDeviceID            = 0
  68. };
  69.  
  70. enum
  71. {
  72.     kInvalidGDFEvent            = 0,
  73.     kGDFDeviceAddedEvent        = 1,
  74.     kGDFDeviceRemovedEvent        = 2
  75. };
  76.  
  77. typedef OSStatus    (GDFExpertEntryPointProc) (void);
  78. typedef GDFExpertEntryPointProc        *GDFExpertEntryPointProcPtr;
  79.  
  80. struct GDFDeviceEventDataStruct
  81. {
  82.     RegEntryID                    deviceRegEntryID;                        // Name Registry ID of device.
  83.     DriverRefNum                driverRefNum;                            // Driver ref num for device.
  84.     OSType                        serviceType;                            // Service type for device.
  85.     UInt32                        deviceEvent;                            // Type of event that occured.
  86.     GDFDeviceID                    gdfDeviceID;                            // GDF device ID of device.
  87.     GDFDeviceEventRegistrationID
  88.                                 gdfDeviceEventRegistrationID;            // Registration ID for this event.
  89.     UInt32                        eventHandlerData;                        // Data for use by handler.
  90. };
  91. typedef struct GDFDeviceEventDataStruct
  92.                                 GDFDeviceEventData,
  93.                                 *GDFDeviceEventDataPtr;
  94.  
  95. typedef OSStatus (GDFDeviceEventHandlerProc) (
  96.     GDFDeviceEventDataPtr        pGDFDeviceEventData);
  97. typedef GDFDeviceEventHandlerProc
  98.                                 *GDFDeviceEventHandlerProcPtr;
  99.  
  100.  
  101. ////////////////////////////////////////////////////////////////////////////////
  102. //
  103. // GDF service descriptor defs.
  104. //
  105.  
  106. enum
  107. {
  108.     kGDFServiceDescriptionSignature    = 'gdfs'
  109. };
  110.  
  111. enum
  112. {
  113.     kInitialGDFServiceDescriptor    = 0
  114. };
  115.  
  116. enum
  117. {
  118.     kGDFServiceIsLoadedUponDiscovery    = (1 << 0)                        // Auto-load GDFService when discovered.
  119. };
  120.  
  121. typedef UInt32                    GDFServiceDescVersion;
  122. typedef UInt32                    GDFServiceOSRunTimeOptions;
  123.  
  124. struct GDFServiceTypeStruct
  125. {
  126.     OSType                         gdfServiceName;                            // GDFService name.
  127.     NumVersion                     version;                                // GDFService version number.
  128.     OSType                         reserved;                                // Reserved area.
  129. };
  130. typedef struct GDFServiceTypeStruct
  131.                                 GDFServiceType,
  132.                                 *GDFServiceTypePtr;
  133.  
  134. struct GDFServiceOSRunTimeStruct
  135. {
  136.     GDFServiceOSRunTimeOptions     gdfServiceRuntime;                        // Options for OS runtime.
  137.     Str31                         gdfServiceName;                            // GDFService's name to the OS
  138.     UInt32                         gdfServiceDescReserved[8];                // Reserved area
  139. };
  140. typedef struct GDFServiceOSRunTimeStruct
  141.                                 GDFServiceOSRunTime,
  142.                                 *GDFServiceOSRunTimePtr;
  143.  
  144. struct GDFServiceDescriptionStruct
  145. {
  146.     OSType                         gdfServiceDescSignature;                // Signature field of this structure.
  147.     GDFServiceDescVersion         gdfServiceDescVersion;                    // Version of this data structure.
  148.     GDFServiceType                 gdfServiceType;                            // Type of driver.
  149.     GDFServiceOSRunTime         gdfServiceOSRuntime;                    // OS runtime requirements of GDFService.
  150. };
  151. typedef struct GDFServiceDescriptionStruct
  152.                                 GDFServiceDescription,
  153.                                 *GDFServiceDescriptionPtr;
  154.  
  155.  
  156. ////////////////////////////////////////////////////////////////////////////////
  157. //
  158. // Generic driver family services.
  159. //
  160.  
  161. OSStatus    GDFRegisterDeviceEventHandlerProc (
  162.     OSType                        serviceType,
  163.     UInt32                        numEvents,
  164.     UInt32                        *eventTable,
  165.     GDFDeviceEventHandlerProcPtr
  166.                                 gdfDeviceEventHandler,
  167.     UInt32                        eventHandlerData,
  168.     GDFDeviceEventRegistrationID
  169.                                 *pGDFDeviceEventRegistrationID);
  170.  
  171. OSStatus    GDFUnregisterDeviceEventHandler (
  172.     GDFDeviceEventRegistrationID
  173.                                 gdfDeviceEventRegistrationID);
  174.  
  175. OSStatus    GDFRegisterFSSpecExpert (
  176.     FSSpecPtr                    pExpertFSSpec);
  177.  
  178. OSStatus    GDFRegisterFSSpecResourceExpert (
  179.     FSSpecPtr                    pExpertFSSpec,
  180.     ResType                        expertResType,
  181.     short                        expertResID);
  182.  
  183. #if PRAGMA_ALIGN_SUPPORTED
  184. #pragma options align=reset
  185. #endif
  186.  
  187. #if PRAGMA_IMPORT_SUPPORTED
  188. #pragma import off
  189. #endif
  190.  
  191. #ifdef __cplusplus
  192. }
  193. #endif
  194.  
  195. #endif /* __GENERICDRIVERFAMILY__ */
  196.